package com.miyu.system.utils.webService;

import com.alibaba.fastjson.JSONObject;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.springframework.util.ResourceUtils;


import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;

public class JSONObjectRead {
    public static void main(String[] args) throws Exception {
//        InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("D:\\webServiceSetting.json");
//       JSONObject json = JSONObject.parseObject(IOUtils.toString(is, "utf-8"));
//        System.out.println(json);
        String path = ResourceUtils.getURL("classpath:").getPath();
        System.out.println("path:"+path);

        String jsonFilePath = "D:\\webServiceSetting.json";
        File file = new File(jsonFilePath );
        String input = FileUtils.readFileToString(file,"UTF-8");
        System.out.println(input);
      //  JSONObject obj = new JSONObject(input);
    }
}
